package me.chendan

import java.io.FileInputStream

import me.chendan.proto.AddressBookProtos
import me.chendan.proto.AddressBookProtos.AddressBook

/**
  * Created by chendan on 16-4-21.
  */
class ReadProtobuf {

}

object ReadProtobuf extends App {
  val addressBook: AddressBookProtos.AddressBook = AddressBook.parseFrom(new FileInputStream("./protobuf/out"))
  val plist: AddressBookProtos.Person = addressBook.getPersonList.get(0)
  println(plist.getName)
}
